import { _decorator, AnimationClip, Component, Event, Node, Animation, SpriteFrame } from 'cc'
import { FSM_PARAMS_TYPE_ENUM, PARAMS_NAME_ENUM } from '../Enums'
import State from './State'
import { StateMachine } from './StateMachine'
const { ccclass, property } = _decorator

export abstract class SubStateMachine {
  private _currentState: State = null
  stateMachines: Map<string, State> = new Map()

  constructor(public fsm: StateMachine) {}

  get currentState() {
    return this._currentState
  }

  set currentState(newState: State) {
    this._currentState = newState
    // 设置当前动画状态之后会执行动画状态真正的运行动画的方法
    this._currentState.run()
  }

  abstract run(): void
}
